package nju.mscs.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import nju.mscs.businesslogic.SC;
import nju.mscs.businesslogic.SM;
import nju.mscs.businesslogic.SearchController;
import nju.mscs.businesslogic.StorageManager;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Stowage_m extends javax.swing.JFrame {
	private JTabbedPane jTabbedPane1;
	private JPanel jPanel1;
	private JLabel jLabel9;
	private JButton jButton4;
	private JButton jButton3;
	private JLabel jLabel8;
	private JLabel jLabel4;
	private JTable jTable3;
	private JPanel jPanel3;
	private JLabel jLabel18;
	private JComboBox jComboBox4;
	private JLabel jLabel17;
	private JComboBox jComboBox3;
	private JLabel jLabel16;
	private JTextField jTextField2;
	private JComboBox jComboBox2;
	private JLabel jLabel3;
	private JComboBox jComboBox1;
	private JLabel jLabel2;
	private JTextField jTextField13;
	private JTextField jTextField12;
	private JTextField jTextField8;
	private JButton jButton8;
	private JButton jButton7;
	private JTable jTable2;
	private JButton jButton6;
	private JButton jButton5;
	private JLabel jLabel14;
	private JLabel jLabel13;
	private JTable jTable1;
	private JButton jButton2;
	private JButton jButton10;
	private JButton jButton9;
	private JButton jButton1;
	private JTextField jTextField7;
	private JTextField jTextField5;
	private JTextField jTextField4;
	private JLabel jLabel7;
	private JLabel jLabel6;
	private JLabel jLabel5;
	private JTextField jTextField1;
	private JLabel jLabel1;
	private JPanel jPanel2;
	private DefaultTableModel jTable1Model;
	private DefaultTableModel jTable2Model;
	private DefaultTableModel jTable3Model;
	
	private SearchController sc = new SC();
	private StorageManager sm = new SM();
	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
		
			public void run() {
				Stowage_m inst = new Stowage_m();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public Stowage_m() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setUndecorated(true);
			{
				jTabbedPane1 = new JTabbedPane();
				getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
				jTabbedPane1.setPreferredSize(new java.awt.Dimension(1292, 715));
				jTabbedPane1.setFont(new java.awt.Font("微软雅黑",0,28));
				{
					jPanel2 = new JPanel();
					jPanel2.setLayout(null);
					jTabbedPane1.addTab("出库", null, jPanel2, null);
					{
						jLabel9 = new JLabel();
						jPanel2.add(jLabel9);
						jLabel9.setText("\u5546\u54c1\u7f16\u53f7");
						jLabel9.setBounds(37, 61, 130, 48);
						jLabel9.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel13 = new JLabel();
						jPanel2.add(jLabel13);
						jLabel13.setText("\u51fa\u5e93\u6570\u91cf");
						jLabel13.setBounds(37, 168, 156, 41);
						jLabel13.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel14 = new JLabel();
						jPanel2.add(jLabel14);
						jLabel14.setText("\u4e0b\u67b6\u539f\u56e0");
						jLabel14.setBounds(628, 64, 128, 43);
						jLabel14.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jButton5 = new JButton();
						jPanel2.add(jButton5);
						jButton5.setText("\u6dfb\u52a0\u5230\u51fa\u5e93\u5217\u8868");
						jButton5.setBounds(779, 163, 287, 51);
						jButton5.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton5.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton5ActionPerformed(evt);
							}
						});
					}
					{
						jButton6 = new JButton();
						jPanel2.add(jButton6);
						jButton6.setText("\u6e05\u7a7a");
						jButton6.setBounds(171, 599, 156, 55);
						jButton6.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton6.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton6ActionPerformed(evt);
							}
						});
					}
					{
						jTable2Model = 
							new DefaultTableModel(
									new String[][]{ },
									new String[] { "商品编号","商品名称","价格","出库数量","下架原因"});
							jTable2 = new JTable(jTable2Model);
						//getContentPane().add(jTable1return, new AnchorConstraint(250, 886, 733, 42, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
						//jTable1.setModel(jTable1Model);
						jTable2.setBounds(24, 105, 632, 204);
						jTable2.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
						jTable2.setSelectionBackground(Color.BLACK);
						jTable2.setSelectionForeground(Color.WHITE);
						jTable2.getTableHeader().setFont(new java.awt.Font("微软雅黑",0,28));
						jTable2.setFont(new java.awt.Font("微软雅黑",0,28));
						jTable2.setRowHeight(30);
						JScrollPane scrollpane2 = new JScrollPane(jTable2);
						//getContentPane().add(scrollpane1return);
						scrollpane2.setBounds(40, 303, 1229, 269);
						jPanel2.add(scrollpane2);	
					}
					{
						jButton7 = new JButton();
						jPanel2.add(jButton7);
						jButton7.setText("\u4fdd\u5b58");
						jButton7.setBounds(733, 599, 175, 60);
						jButton7.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton7.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton7ActionPerformed(evt);
							}
						});
					}
					{
						jButton8 = new JButton();
						jPanel2.add(jButton8);
						jButton8.setText("\u8fd4\u56de");
						jButton8.setBounds(1036, 597, 166, 64);
						jButton8.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton8.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton8ActionPerformed(evt);
							}
						});
					}
					{
						jTextField8 = new JTextField();
						jPanel2.add(jTextField8);
						jTextField8.setBounds(164, 60, 365, 51);
						jTextField8.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jTextField12 = new JTextField();
						jPanel2.add(jTextField12);
						jTextField12.setBounds(164, 163, 370, 51);
						jTextField12.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jTextField13 = new JTextField();
						jPanel2.add(jTextField13);
						jTextField13.setBounds(756, 58, 480, 54);
						jTextField13.setFont(new java.awt.Font("微软雅黑",0,28));
					}
				}
				{
					jPanel1 = new JPanel();
					jTabbedPane1.addTab("入库", null, jPanel1, null);
					jPanel1.setLayout(null);
					jPanel1.setPreferredSize(new java.awt.Dimension(648, 339));
					{
						jLabel1 = new JLabel();
						jPanel1.add(jLabel1);
						jLabel1.setText("\u5546\u54c1\u7f16\u53f7");
						jLabel1.setBounds(34, 77, 138, 50);
						jLabel1.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jTextField1 = new JTextField();
						jPanel1.add(jTextField1);
						jTextField1.setBounds(172, 85, 393, 42);
						jTextField1.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel5 = new JLabel();
						jPanel1.add(jLabel5);
						jLabel5.setText("\u5165\u5e93\u6570\u91cf");
						jLabel5.setBounds(704, 87, 135, 39);
						jLabel5.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel6 = new JLabel();
						jPanel1.add(jLabel6);
						jLabel6.setText("\u751f\u4ea7\u65e5\u671f");
						jLabel6.setBounds(35, 164, 131, 41);
						jLabel6.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel7 = new JLabel();
						jPanel1.add(jLabel7);
						jLabel7.setText("\u62a5\u5e9f\u65e5\u671f");
						jLabel7.setBounds(704, 161, 145, 46);
						jLabel7.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel8 = new JLabel();
						jPanel1.add(jLabel8);
						jLabel8.setText("\u6210\u672c\u4ef7\u683c");
						jLabel8.setBounds(35, 252, 149, 43);
						jLabel8.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jTextField4 = new JTextField();
						jPanel1.add(jTextField4);
						jTextField4.setBounds(845, 85, 434, 42);
						jTextField4.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jTextField5 = new JTextField();
						jPanel1.add(jTextField5);
						jTextField5.setBounds(172, 164, 134, 41);
						jTextField5.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jTextField7 = new JTextField();
						jPanel1.add(jTextField7);
						jTextField7.setBounds(174, 251, 287, 45);
						jTextField7.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jButton1 = new JButton();
						jPanel1.add(jButton1);
						jButton1.setText("\u6dfb\u52a0");
						jButton1.setBounds(796, 253, 119, 40);
						jButton1.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton1.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton1ActionPerformed(evt);
							}
						});
					}
					{
						jButton2 = new JButton();
						jPanel1.add(jButton2);
						jButton2.setText("\u6e05\u7a7a");
						jButton2.setBounds(121, 613, 140, 50);
						jButton2.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton2.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton2ActionPerformed(evt);
							}
						});
					}
					{jTable1Model = 
						new DefaultTableModel(
								new String[][]{ },
								new String[] { "商品标识","描述","价格","入库数量","生产日期","报废日期","成本价格/元"});
					jTable1 = new JTable(jTable1Model);
					//getContentPane().add(jTable1return, new AnchorConstraint(250, 886, 733, 42, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
					//jTable1.setModel(jTable1Model);
					jTable1.setBounds(24, 105, 632, 204);
					jTable1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
					jTable1.setSelectionBackground(Color.BLACK);
					jTable1.setSelectionForeground(Color.WHITE);
					jTable1.getTableHeader().setFont(new java.awt.Font("微软雅黑",0,28));
					jTable1.setFont(new java.awt.Font("微软雅黑",0,28));
					jTable1.setRowHeight(30);
					JScrollPane scrollpane1 = new JScrollPane(jTable1);
					//getContentPane().add(scrollpane1return);
					scrollpane1.setBounds(35, 389, 1268, 186);
					jPanel1.add(scrollpane1);
					}
					{
						jButton3 = new JButton();
						jPanel1.add(jButton3);
						jButton3.setText("\u4fdd\u5b58");
						jButton3.setBounds(827, 613, 137, 56);
						jButton3.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton3.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton3ActionPerformed(evt);
							}
						});
					}
					{
						jButton4 = new JButton();
						jPanel1.add(jButton4);
						jButton4.setText("\u8fd4\u56de");
						jButton4.setBounds(1078, 613, 145, 56);
						jButton4.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton4.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton4ActionPerformed(evt);
							}
						});
					}
					{
						jLabel2 = new JLabel();
						jPanel1.add(jLabel2);
						jLabel2.setText("\u5e74");
						jLabel2.setBounds(310, 164, 49, 40);
						jLabel2.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						ComboBoxModel jComboBox1Model = 
							new DefaultComboBoxModel(
									new String[] { "1", "2","3","4","5","6","7","8","9","10","11","12" });
						jComboBox1 = new JComboBox();
						jPanel1.add(jComboBox1);
						jComboBox1.setModel(jComboBox1Model);
						jComboBox1.setBounds(342, 164, 88, 40);
						jComboBox1.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel3 = new JLabel();
						jPanel1.add(jLabel3);
						jLabel3.setText("\u6708");
						jLabel3.setBounds(436, 168, 42, 33);
						jLabel3.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						ComboBoxModel jComboBox2Model = 
							new DefaultComboBoxModel(
									new String[] { "1","2","3","4","5","6","7","8","9","10","11","12",
											"13","14","15","16","17","18","19","20","21","22","23","24","25",
											"26","27","28","29","30","31"});
						jComboBox2 = new JComboBox();
						jPanel1.add(jComboBox2);
						jComboBox2.setModel(jComboBox2Model);
						jComboBox2.setBounds(468, 162, 103, 44);
						jComboBox2.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel4 = new JLabel();
						jPanel1.add(jLabel4);
						jLabel4.setText("\u65e5");
						jLabel4.setBounds(577, 165, 44, 38);
						jLabel4.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jTextField2 = new JTextField();
						jPanel1.add(jTextField2);
						jTextField2.setBounds(820, 165, 132, 42);
						jTextField2.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel16 = new JLabel();
						jPanel1.add(jLabel16);
						jLabel16.setText("\u5e74");
						jLabel16.setBounds(958, 168, 41, 37);
						jLabel16.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						ComboBoxModel jComboBox3Model = 
							new DefaultComboBoxModel(
									new String[] { "1", "2","3","4","5","6","7","8","9","10","11","12" });
						jComboBox3 = new JComboBox();
						jPanel1.add(jComboBox3);
						jComboBox3.setModel(jComboBox3Model);
						jComboBox3.setBounds(991, 164, 107, 44);
						jComboBox3.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel17 = new JLabel();
						jPanel1.add(jLabel17);
						jLabel17.setText("\u6708");
						jLabel17.setBounds(1104, 166, 43, 40);
						jLabel17.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						ComboBoxModel jComboBox4Model = 
							new DefaultComboBoxModel(
									new String[] { "1","2","3","4","5","6","7","8","9","10","11","12",
											"13","14","15","16","17","18","19","20","21","22","23","24","25",
											"26","27","28","29","30","31"});
						jComboBox4 = new JComboBox();
						jPanel1.add(jComboBox4);
						jComboBox4.setModel(jComboBox4Model);
						jComboBox4.setBounds(1132, 166, 103, 40);
						jComboBox4.setFont(new java.awt.Font("微软雅黑",0,28));
					}
					{
						jLabel18 = new JLabel();
						jPanel1.add(jLabel18);
						jLabel18.setText("\u65e5");
						jLabel18.setBounds(1241, 167, 43, 39);
						jLabel18.setFont(new java.awt.Font("微软雅黑",0,28));
					}
				}
				{
					jPanel3 = new JPanel();
					jTabbedPane1.addTab("库存分析", null, jPanel3, null);
					jPanel3.setLayout(null);
					{
						
						jTable3Model = 
							new DefaultTableModel(
									new String[][]{ },
									new String[] { "商品标识","描述","价格","预计天数","预计报废率"});
						jTable3 = new JTable(jTable3Model);
						//getContentPane().add(jTable1return, new AnchorConstraint(250, 886, 733, 42, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
						//jTable1.setModel(jTable1Model);
						jTable3.setBounds(24, 105, 632, 204);
						jTable3.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
						jTable3.setSelectionBackground(Color.BLACK);
						jTable3.setSelectionForeground(Color.WHITE);
						jTable3.getTableHeader().setFont(new java.awt.Font("微软雅黑",0,28));
						jTable3.setFont(new java.awt.Font("微软雅黑",0,28));
						jTable3.setRowHeight(30);
						JScrollPane scrollpane3 = new JScrollPane(jTable3);
						//getContentPane().add(scrollpane1return);
						scrollpane3.setBounds(45, 77, 1222, 399);
						jPanel3.add(scrollpane3);
					}
					{
						jButton9 = new JButton();
						jPanel3.add(jButton9);
						jButton9.setText("\u67e5\u8be2");
						jButton9.setBounds(601, 569, 189, 56);
						jButton9.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton9.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton9ActionPerformed(evt);
							}
						});
					}
					{
						jButton10 = new JButton();
						jPanel3.add(jButton10);
						jButton10.setText("\u8fd4\u56de");
						jButton10.setBounds(968, 567, 179, 60);
						jButton10.setFont(new java.awt.Font("微软雅黑",0,28));
						jButton10.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								jButton10ActionPerformed(evt);
							}
						});
					}
				}
			}
			pack();
			this.setSize(1340, 768);
			getGraphicsConfiguration().getDevice().setFullScreenWindow(this);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	private void jButton1ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton1.actionPerformed, event="+evt);
		String goodsid1 = jTextField1.getText();
		String goodsamount1 = jTextField4.getText();
		String pyear1 = jTextField5.getText();
		String pmonth1 = jComboBox1.getSelectedItem().toString();
		String pday1 = jComboBox2.getSelectedItem().toString();
		String pdate1 = pyear1+"/"+pmonth1+"/"+pday1;
		String tyear1 = jTextField2.getText();
		String tmonth1 = jComboBox3.getSelectedItem().toString();
		String tday1 = jComboBox4.getSelectedItem().toString();
		String tdate1 = tyear1+"/"+tmonth1+"/"+tday1;
		String primecost1 = jTextField7.getText();
		if(goodsid1.equals("")||goodsamount1.equals("")||pyear1.equals("")||tyear1.equals("")||primecost1.equals("")
				||Integer.parseInt(pyear1)>Integer.parseInt(tyear1)){
			JOptionPane.showMessageDialog(this,"入库货物信息不正确！ ");
			return;
		}
		String goodsname1 = sc.getGoods(goodsid1)[1];
		String goodsprice1 = sc.getGoods(goodsid1)[2];
		String[] goodsinfo1 = new String[]{goodsid1,goodsname1,goodsprice1,goodsamount1,pdate1,tdate1,primecost1};
        jTable1Model.addRow(goodsinfo1);
        jTextField1.setText("");
        jTextField4.setText("");
        jTextField5.setText("");
        jTextField2.setText("");
        jTextField7.setText("");
        jComboBox1.setSelectedIndex(0);
        jComboBox2.setSelectedIndex(0);
        jComboBox3.setSelectedIndex(0);
        jComboBox4.setSelectedIndex(0);
	}//入库添加按钮
	
	private void jButton2ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton2.actionPerformed, event="+evt);
		jTable1Model.setRowCount(0);
	}//入库清空按钮
	
	private void jButton3ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton3.actionPerformed, event="+evt);
		int rownum1 = jTable1.getRowCount();
		String[][] goodslist1 = new String[rownum1][7];
		for(int i=0;i<rownum1;i++){
			for(int j=0;j<7;j++){
				goodslist1[i][j]=jTable1.getValueAt(i, j).toString();
			}
		}
		Boolean result1 = sm.storeChange(goodslist1);
		if(result1){
			JOptionPane.showMessageDialog(this,"保存成功！ ");
			return;
		}
		else{
			JOptionPane.showMessageDialog(this,"保存失败！ ");
			return;
		}
	}//入库保存按钮
	
	private void jButton5ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton5.actionPerformed, event="+evt);
		String goodsid2=jTextField8.getText();
		String reason2 = jTextField13.getText();
		String amount2 = jTextField12.getText(); 
		String goodsname2 = sc.getGoods(goodsid2)[1];
		String goodsprice2 = sc.getGoods(goodsid2)[2];
		if(goodsid2.equals(null)||reason2.equals(null)||amount2.equals(null)||goodsname2.equals(null)){
			JOptionPane.showMessageDialog(this,"出库货物信息不正确！ ");
			return;
		}
		String[] goodsinfo2 = new String[]{goodsid2,goodsname2,goodsprice2,reason2,amount2};
		jTable2Model.addRow(goodsinfo2);
		 jTextField8.setText("");
	     jTextField13.setText("");
	     jTextField12.setText("");
	}//出库添加按钮
	
	private void jButton6ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton6.actionPerformed, event="+evt);
		jTable2Model.setRowCount(0);
	}//出库清空按钮
	
	private void jButton7ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton7.actionPerformed, event="+evt);
		int rownum2 = jTable2.getRowCount();
		String[][] goodslist2 = new String[rownum2][5];
		for(int i=0;i<rownum2;i++){
			for(int j=0;j<5;j++){
				goodslist2[i][j]=jTable1.getValueAt(i, j).toString();
			}
		}
		Boolean result2 = sm.removalChange(goodslist2);
		if(result2){
			JOptionPane.showMessageDialog(this,"保存成功！ ");
			return;
		}
		else{
			JOptionPane.showMessageDialog(this,"保存失败！ ");
			return;
		}
	}//出库保存按钮
	
	private void jButton9ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton9.actionPerformed, event="+evt);
		String[][] analysis= sm.storageAnalysis();
		if(analysis.equals(null)){
			JOptionPane.showMessageDialog(this,"暂无数据！ ");
			return;
		}
		jTable3Model.setRowCount(0);
		for(int i=0;i<analysis.length;i++){
			jTable3Model.addRow(analysis[i]);
		}
	}//库存分析-查询按钮
	
	private void jButton8ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton8.actionPerformed, event="+evt);
		Sub_manager.main(null);
		this.dispose();
	}
	
	private void jButton4ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton4.actionPerformed, event="+evt);
		Sub_manager.main(null);
		this.dispose();
	}
	
	private void jButton10ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton10.actionPerformed, event="+evt);
		Sub_manager.main(null);
		this.dispose();
	}

}
